﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using bzxxxt.admin.service;

namespace bzxxxt.admin.ashx
{
    /// <summary>
    /// rm_operatelog 的摘要说明
    /// </summary>
    public class rm_operatelog : rm_base
    {
        OperateLogService s = new OperateLogService();

        public override void getall(HttpContext context)
        {
            string json = s.getall();
            context.Response.Write(json);
        }

        public override void search(HttpContext context)
        {
            string strWhere = context.Request.Params["where"] ?? "1=1";   //条件
            string sort = context.Request.Params["sort"] ?? "id";       //排序列
            string order = context.Request.Params["order"] ?? "asc";     //排序方式 asc或者desc
            int pageIndex = int.Parse(context.Request.Params["page"] ?? "1");
            int pageSize = int.Parse(context.Request.Params["rows"] ?? "20");

            string json = s.search(pageSize, pageIndex, sort + " " + order, strWhere);
            context.Response.Write(json);
        }

        public override void delete(HttpContext context)
        {
            string ids = context.Request.Params["ids"];
            string json = s.delete(ids);
            context.Response.Write(json);
        }
    }
}